<% import grails.persistence.Event %>
<g:set var="ownerActionName" value="add\${ownedProperty}" />
<g:set var="ownerContainerName" value="\${ownedProperty}formcontainer" />


<g:formRemote name="inline${domainClass.propertyName}" url="[controller: ownerController ,action: ownerActionName, params: [ownerId:ownerId]]" onSuccess="appendTableRow('\${ownedProperty}_list', e, false,'${domainClass.propertyName}_\${ownerId}_tr'); ">

              <table>
                <tbody> <tr class="prop">
                        <%  excludedProps = Event.allEvents.toList() << 'version' << 'id'
                            props = domainClass.properties.findAll { !excludedProps.contains(it.name) }
                            //Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
                            props.each { p ->
                                if (!Collection.class.isAssignableFrom(p.type)) {
                                    cp = domainClass.constrainedProperties[p.name]
                                    display = (cp ? cp.display : true)
                                    if (display) { %>

                                <td valign="top" class="name">
                                    <label for="${p.name}"><g:message code="${domainClass.propertyName}.${p.name}.label" default="${p.naturalName}" /></label>
                                </td>
                                <td valign="top" class="value \${hasErrors(bean: ${propertyName}, field: '${p.name}', 'errors')}">
                                    ${renderEditor(p)}
                                </td>

                        <%  }   }   } %>
              </tr>
              <tr>  
              <td colspan="${props.size()}">

                <g:submitButton name="save">Save</g:submitButton>
              </td>
            </tr>
             </tbody>

            </table>
   </g:formRemote>